<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>预约挂号系统后台管理</title>
		<link rel="stylesheet" href="/assets/css/core.css" />
		<link rel="stylesheet" href="/assets/css/menu.css" />
		<link rel="stylesheet" href="/assets/css/amazeui.css" />
		<link rel="stylesheet" href="/assets/css/component.css" />
		<link rel="stylesheet" href="/assets/css/form.css" />
		<script src="/assets/js/jquery.min.js"></script>
	</head>
	<body>
		<div class="account-pages">
			<div class="wrapper-page">
				<div class="text-center">
	                <a href="javascript:;" class="logo"><span>预约系统管理后台</span></a>
	            </div>
	            
	            <div class="m-t-40 card-box">
	            	<div class="text-center">
	                    <h4 class="text-uppercase font-bold m-b-0">管理员登录</h4>
	                </div>
	                <div class="panel-body">
	                	<form class="am-form">
	                		<div class="am-g">
	                			<div class="am-form-group">
							      <input type="text" id="username" name="username" class="am-radius"  placeholder="请输入账号">
							    </div>
							
							    <div class="am-form-group form-horizontal m-t-20">
							      <input type="password" id="password" name="password" class="am-radius"  placeholder="请输入密码">
							    </div>
							    
							    {{--<div class="am-form-group ">--}}
		                           	{{--<label style="font-weight: normal;color: #999;">--}}
								        {{--<input type="checkbox" class="remeber"> Remember me--}}
								    {{--</label>--}}
		                        {{--</div>--}}
		                        
		                        <div class="am-form-group ">
		                        	<button type="button" onclick="login()" class="am-btn am-btn-primary am-radius" style="width: 100%;height: 100%;">登录</button>
		                        </div>
		                        
		                        {{--<div class="am-form-group ">--}}
		                        {{--<a href="page-recoverpw.html" class="text-muted"><i class="fa fa-lock m-r-5"></i> Forgot your password?</a>--}}
		                        {{--</div>--}}
	                		</div>

	                	</form>
							
	                </div>
	            </div>
			</div>
		</div>
		<script>
			function login() {
				var url = "{{urlAdmin('login','postLogin')}}";
				var username = $('#username').val();
				var password = $('#password').val();
				var data = {username:username,password:password};
				$.post(url,data,function(res){
					if (res.status == 1) {
						window.location.href = res.url;
					} else {
						alert(res.msg);
					}
				});
			}
			// 回车提交表单
			$('.am-form').keydown(function (event) {
				if (event.keyCode == 13) {login();}
			});
		</script>
	</body>
</html>
